//
//  BaseObject.m
//  CNstorm
//
//  Created by 陈家将 on 2017/1/5.
//  Copyright © 2017年 chenjiajiang. All rights reserved.
//

#import "BaseObject.h"

@implementation BaseObject

- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property{
    if ([self isEmpty:oldValue]) {
        oldValue = @"";
    }
    return oldValue;
}

-(BOOL)isEmpty:(NSString*)text{
    
    @try {
        if ([text isKindOfClass:[NSNull class]])
        {
            return YES;
        }else if ([text isEqual:[NSNull null]]) {
            return YES;
        }
        else if (text == nil){
            return YES;
        } else if ([@"" isEqualToString:text]){
            
            return YES;
        }
        return NO;
    } @catch (NSException * e) {

        return NO;
    }
}

@end
